package com.zd.commodity.intercepter;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class LoginInterceptor extends MethodFilterInterceptor {


	@Override
	protected String doIntercept(ActionInvocation invocation) throws Exception {
		Object object = ActionContext.getContext().getSession().get("user");
		if(null == object){  
            return "login";  // 这里返回用户登录页面视图  
        }else{
        	invocation.invoke();
        }
		return null;
	}

}
